package cn.easthome.demo.day0060_pm.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 项目的工具类
 */
public class GlobalUtil {

    //格式化时间字符串
    public static String getTime(long time){
        //将时间转换成Date
        Date date = new Date(time);
        //格式化时间字符串
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(date);
        return timeStr;
    }
}
